<?php
include("header.php");

	$mydirname = basename( dirname( __FILE__ ) ) ;
	
	require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ;

$myts =& MyTextSanitizer::getInstance();
$module_id = $xoopsModule->getVar('mid');

 if (is_object($xoopsUser)) {
    $groups = $xoopsUser->getGroups();
} else {
	$groups = XOOPS_GROUP_ANONYMOUS;
}

$gperm_handler =& xoops_gethandler('groupperm');

if (isset($_POST['item_id'])) {
    $perm_itemid = intval($_POST['item_id']);
} else {
    $perm_itemid = 0;
}

if (!in_array(68, $groups)){

if (!$gperm_handler->checkRight("jobs_view", $perm_itemid, $groups, $module_id)) {
    redirect_header("bienvenida.php", 3, _NOPERM);
    exit();
} 
}

include(XOOPS_ROOT_PATH."/class/xoopstree.php");
include(XOOPS_ROOT_PATH."/modules/$mydirname/include/functions.php");

/*list($ann) = $xoopsDB->fetchRow($xoopsDB->query("select  COUNT(*)  FROM ".$xoopsDB->prefix("jobs_listing")." WHERE valid='Yes'"));*/


function jobsListing(){
    global $xoopsDB, $xoopsTpl, $xoopsConfig, $xoopsModuleConfig, $myts, $mytree, $imagecat, $meta, $mydirname;
    $GLOBALS['xoopsOption']['template_main'] = "jobs_resumelisting.html";
    include (XOOPS_ROOT_PATH."/class/pagenav.php");
	$xoopsTpl->assign('add_from', _JOBS_ADDFROM." ".$xoopsConfig['sitename']);
	// Add Template assign  by Tom
	$xoopsTpl->assign('add_from_title', _JOBS_ADDFROM );
	$xoopsTpl->assign('add_from_sitename', $xoopsConfig['sitename']);
	
	$result = $xoopsDB->query("select * FROM ".$xoopsDB->prefix("jobs_listing")." where valid='Yes'");
	$list = array();
        while($myrow = $xoopsDB->fetchArray($result)) {
        $list []= $myrow;

        }

	$xoopsTpl->assign('list', $list);
}



$xoopsOption['template_main'] = 'jobs_resumelisting.html';
		include(XOOPS_ROOT_PATH."/header.php");
		jobsListing();
		
		
		include(XOOPS_ROOT_PATH."/footer.php");

?>
